<template>
	<view class="newActivePage">
		<image :src="join_group_bg" class="image" @click="receiveGroupFree"></image>
	</view>
</template>

<script>
	import api from '@/api/index.js';
	export default {
		data() {
			return {
				join_group_bg: null,
			}
		},
		// onShareAppMessage() {
		// 	return {
		// 		title: "新用户进群免单",
		// 		imageUrl: this.group_code_image,
		// 		path: "/pages/active/groupActive?date=2024-12-13",
		// 	};
		// },
		onLoad(options) {
			this.getFreeActive()
		},
		methods: {
			//领取新人免单券
			receiveGroupFree() {
				api.receiveGroupFree().then(res => {
					uni.showToast({
						title: "领取成功"
					})
					setTimeout(() => {
						uni.navigateBack({
							delta: 1
						})
					}, 1500)
				})
			},
			getFreeActive() {
				api.getFreeActive().then(res => {
					this.join_group_bg =  res.data.join_group_bg2
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.newActivePage {
		position: relative;
		width: 100%;
		height: 100vh;
		overflow: hidden;
		.cqrode{
			position: absolute;
			width: 200rpx;
			height: 200rpx;
			top: 20%;
			left: 50%;
			transform: translate(-50%);
			z-index: 100;
		}
		.image {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 100%;
			object-fit: cover;
		}
	}
</style>